<nav class="navbar navbar-default navbar-fixed-top">
		<!-- Brand and toggle get grouped for better mobile display -->
	<div class="container">
		<a class="navbar-brand" href="/">Manager</a>
		<ul class="nav navbar-nav">
			
			<%if(!user){%>
				<li <%=tempName == 'register'?'class=active':''%>><a href="/register" >Register</a></li>
				<li <%=tempName == 'login'?'class=active':''%>><a href="/login"  >Login</a></li>
			<%}%>
			<li <%=tempName == 'forum'?'class=active':''%>><a href="/forum?cate=all&page=1" >Forum</a></li>
			<li <%=tempName == 'createTopic'?'class=active':''%>><a href="/topics/create" >Post</a></li>
			<li <%=tempName == 'userList'?'class=active':''%>><a href="/users/userList" >User List</a></li>
			<li <%=tempName == 'fileUpload'?'class=active':''%>><a href="/util/fileUpload" >File Upload</a></li>
		</ul>
		<ul class="nav navbar-nav navbar-right">
			<% if(user){%>
				<%console.log(user.avatar)%>
				<ul class="nav navbar-nav">
					<li style="margin-top:10px">
						<img src="<%= (user.avatar ? user.avatar : '/images/avatar.png')%>" style="width:30px;height:30px"/>
					</li>
				</ul>
				<li class="dropdown">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
						Welcome, <%=user.username%> <span class="caret"></span>
					</a>
					<ul class="dropdown-menu">
						<li><a href="/users/userCenter/<%=user._id%>">User Center</a></li>
						<li><a href="/users/security/<%=user._id%>">Security</a></li>
						<li><a href="/users/logout">Logout</a></li>
					</ul>
				</li>
			<%}else{%>
				<li><a href="/login">Please login.</a></li>
			<%}%>
		</ul>
	</div>
</nav>
<script>
	function goto(url){
		$.post(url);
	}
</script>